package com.kanche.bigbaby.collection.domain;

import java.io.Serializable;

/**
 * Created by nealmi on 8/4/14.
 */
public class DistributionJob implements Serializable {

    public static final String JOB_CATEGORY_REMOVE = "remove";
    public static final String KANCHE_COM_ID = "kanche.com";
    public static final DistributionJob KANCHE_COM = DistributionJob.create(KANCHE_COM_ID);
    public static final String ADD_NEW_ID = "add_new";
    public static final DistributionJob ADD_NEW = DistributionJob.create(ADD_NEW_ID);
    private String id;
    private Vehicle vehicle;
    private ShareAccount shareAccount;
    private String status;
    private String statusMessage;
    private String createAt;
    private String updateAt;
    private String category;
    private DistributionJobLog lastHistory;
    private int seriesNumber;

    public static DistributionJob create() {
        return new DistributionJob();
    }

    public static DistributionJob create(String id) {
        DistributionJob job = new DistributionJob();
        job.setId(id);
        return job;
    }


    public String getTitle() {
        if (vehicle != null && vehicle.getSpec() != null)
            return vehicle.getSpec().getDisplayShort();
        return "";
    }

    public String getSubtitle() {
        if (vehicle != null && vehicle.getSpec() != null)
            return vehicle.getSpec().getSaleName();
        return "";
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Vehicle getVehicle() {
        return vehicle;
    }

    public void setVehicle(Vehicle vehicle) {
        this.vehicle = vehicle;
    }

    public ShareAccount getShareAccount() {
        return shareAccount;
    }

    public void setShareAccount(ShareAccount shareAccount) {
        this.shareAccount = shareAccount;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getCreateAt() {
        return createAt;
    }

    public void setCreateAt(String createAt) {
        this.createAt = createAt;
    }

    public String getUpdateAt() {
        return updateAt;
    }

    public void setUpdateAt(String updateAt) {
        this.updateAt = updateAt;
    }

    public int getSeriesNumber() {
        return seriesNumber;
    }

    public void setSeriesNumber(int seriesNumber) {
        this.seriesNumber = seriesNumber;
    }

    public String getStatusMessage() {
        return statusMessage;
    }

    public void setStatusMessage(String statusMessage) {
        this.statusMessage = statusMessage;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public DistributionJobLog getLastHistory() {
        return lastHistory;
    }

    public void setLastHistory(DistributionJobLog lastHistory) {
        this.lastHistory = lastHistory;
    }

    public boolean isRemoveJob() {
        return JOB_CATEGORY_REMOVE.equalsIgnoreCase(category);
    }
}




